<#import "../tpl/pageTep.ftl" as page>
    <@page.pageBase currentMenu="车辆信息">

    <!--suppress ALL -->
    <form id="searchForm" class="form-panel" action="/rest/manage/cart/selectCartPage">
        <ul class="panel-content">
            <li>
                <div class="form-actions">
                    <div class="control-group controls span5">
                        <input type="text" id="searchForm" class="input-normal  input-pad cartNo" name="cartNo">
                    </div>
                    <div class="form-actions  controls">
                        <button type="submit" class="button button-small button-success">
                            查询
                        </button>
                    </div>
                </div>
            </li>
        </ul>
    </form>
    <div id="grid"></div>
<script>
var Grid = BUI.Grid,
        Store = BUI.Data.Store,
        columns = [
            {title : '主键',elCls: 'center',dataIndex :'id', width:'10%'},
            {title : '卡号',elCls: 'center',dataIndex :'cardNo', width:'18%'},
            {title : '车牌号',elCls: 'center',dataIndex :'cartNo', width:'18%'},
            {title : '司机名称',elCls: 'center',dataIndex :'driver', width:'18%'},
            {title : '所属单位',elCls: 'center',dataIndex :'department', width:'18%'},
            {title : '车辆吨位',elCls: 'center',dataIndex :'weight', width:'18%'},
        ];

var store = new Store({
            url : '/rest/manage/cart/selectCartPage',
            autoLoad:true, //自动加载数据
            params : { //配置初始请求的参数
                length : '10',
            },
            pageSize:10,	// 配置分页数目
            root : 'list',
            totalProperty : 'total'
        }),
        grid = new Grid.Grid({
            render:'#grid',
            columns : columns,
            loadMask: true, //加载数据时显示屏蔽层
            store: store,
            plugins : [Grid.Plugins.CheckSelection], // 插件形式引入多选表格
            // 底部工具栏
            bbar:{
                pagingBar:true
            }
        });

grid.render();

var form = new BUI.Form.HForm({
    srcNode: '#searchForm'
}).render();

form.on('beforesubmit', function (ev) {
    var obj = form.serializeToObject();
    obj.start = 0; //返回第一页
    store.load(obj);
    return false;
});

</script>

</@page.pageBase>
